package com.myspring.dao.impl;

import com.myspring.dao.AccountDao;
import com.myspring.po.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * ClassName: AccountDaoImpl
 * Package: com.myspring.dao.impl
 * Description:
 *
 * @Author 刘英杰
 * @Create 2025/2/7 10:29
 * @Version 1.0
 */

@Repository
public class AccountDaoImpl implements AccountDao {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public void update(Account account) {
        jdbcTemplate.update("UPDATE spring.account SET money = money + ? WHERE name = ?",
                account.getMoney(), account.getName());
    }
}
